<template>
	<view>
		<view class="content">
			<view class="head">
				<view class="swiper">
					<swiper bindchange="onBindchange">
						<block v-for="(item,index) in swiper" :key="index">
							<swiper-item :data-id="index">
								<!-- <video wx:if="{{swiperId==0}}" id="myVideo" src="{{item}}" controls autoplay="{{true}}"></video> -->
								<image id="merchandise" mode="aspectFit"
									:src="[item!=''?item:'../../../../image/errorImage.jpg']"></image>
							</swiper-item>
						</block>
					</swiper>
				</view>

				<view class="explain type1" v-if="id==0">
					<view class="explain-v1">
						<text>拼团</text>
						<text>限时火拼 超值低价</text>
					</view>
					<view class="explain-v2">
						<text>距离结束仅剩</text>
						<text v-if="activiStatus!='不可用'">{{days}} 天 {{hours}} 时 {{minutes}} 分 {{seconds}} 秒</text>
						<text v-else> 0 天 0 时 0 分 0 秒</text>
					</view>
				</view>
				<view class="participate">
					<view class="select-title">
						<text>{{spellData.FName}}</text>
						<button class="select-partic" open-type="share" hover-class="none">
							<image id="participate" src="http://minipos.posyun3721.com/image/marketing/participate.png">
							</image>
							<text>分享</text>
						</button>
					</view>
					<view class="select-price">
						<view class="price">
							<view class="amount">
								<text>¥<text class="money">{{spellData.FValue}}</text></text>
								<text>原价:¥{{spellData.FPosPrice}}</text>
							</view>
							<view class="">

							</view>
						</view>
						<view class="select-people">
							<view class="people">
								<image class="people-img"
									src="http://minipos.posyun3721.com/image/marketing/surplus.png"></image>
								<text>剩余:{{residuals}}份</text>
							</view>
							<view class="people">
								<image class="people-img"
									src="http://minipos.posyun3721.com/image/marketing/people-img2.png"></image>
								<text>浏览:{{browse}}人</text>
							</view>
							<view class="people">
								<image class="people-img" src="http://minipos.posyun3721.com/image/marketing/user.png">
								</image>
								<text>参与:{{participate}}人</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="spell">
				<!-- <view class="imageBox" wx:if="{{uid==''}}">
		      <image class="select-portrait" wx:for="{{usetsArr}}" wx:key="index" src="{{item.FAvatarUrl}}"></image>
		    </view> -->
				<view class="imageBox" v-if="share==0">
					<image class="select-portrait" :class="[uid==item.FItemID?'':'none']"
						v-for="(item,isBeGranted) in usersImg" :key="index" :src="item.FAvatarUrl"></image>
				</view>
				<!-- <view class="{{share==0?'':'none'}}"> -->
				<text class="userT" v-if="activiStatus!='不可用'&&userInfoId!=2">拼单时间剩下<text class="time">{{days}} 天
						{{hours}} 时 {{minutes}} 分 {{seconds}} 秒</text>后结束</text>
				<text class="userT" v-else-if="activiStatus!='不可用'&&userInfoId==2">订单已完成</text>

				<!-- </view> -->
				<view v-if="share==1">
					<button class="type1" id="immediately" v-if="activiStatus!='不可用'&&userID==0" @click="onStart"
						vlaue="">发起拼单</button>
					<button class="type1" id="immediately" v-else-if="activiStatus!='不可用'&&userID==1" open-type="share"
						hover-class="none">邀请拼团</button>
					<button class="type1" id="immediately" v-else vlaue="" @click="">活动已结束</button>
				</view>
				<view v-else>
					<button class="type1" id="immediately" @click="onChilds" :data-id="spellChildId"
						v-if="activiStatus!='不可用'&&userInfoId==0" vlaue="">帮忙拼一单</button>
					<button class="type1" id="immediately" v-else-if="activiStatus!='不可用'&&userInfoId==1" vlaue=""
						open-type="share" hover-class="none">邀请拼团</button>
					<button class="type1" id="immediately" v-else-if="activiStatus!='不可用'&&userInfoId==2"
						vlaue="">订单已完成</button>
				</view>
			</view>
			<view class="select-other" :class="[childSet==''?'none':'']" v-if="share==1">
				<view class="other-head" :class="[usetsArr==''?'none':'']" @click="onFind" v-if="activiStatus!='不可用'">
					<text>{{participate}}人在参与</text>
					<text>查看更多></text>
				</view>
				<view class="other-box" :class="[(item.GroupQty-item.ActQty)==0?'none':'']"
					v-for="(item,index) in usetsArr" :key="index" v-if="activiStatus!='不可用'">
					<view class="initiator">
						<image class="initiator-img" :src="item.FAvatarUrl"></image>
						<text>{{item.FNiName}}</text>
					</view>
					<view class="part">
						<text>还差<text
								class="time">{{(item.GroupQty-item.ActQty)>2?2:item.GroupQty-item.ActQty}}人</text>成团</text>
						<button class="part-btu" @click="onChilds" v-if="userInfoUid!=item.Users&&userInfoId!=1"
							:data-id="item.Childid">去拼单</button>
						<button class="part-btu" wx:else open-type="share" hover-class="none">去邀请</button>
					</view>
				</view>
			</view>

			<view class="select-other none" v-if="share==1">
				<view class="other-head">
					<text>用户评价（115）</text>
					<text style="color: #333;">99.6%好评></text>
				</view>
				<view class="other-box">
					<view class="evaluation">
						<image class="evaluation-img" src=""></image>
						<text>cingcing</text>
						<text>2019.07.04</text>
					</view>
					<text>每次搞活动都过来这家抢，非常划算！</text>
				</view>
			</view>
			<view class="activity" v-if="share==1">
				<view class="activity-head" @click="onSwitch">
					<text class="activity-text" :class="[activityTypeID==0?'active1':'']" data-id="0">活动详情</text>
					<text class="activity-text" :class="[activityTypeID==1?'active1':''] " data-id="1">活动规则</text>
				</view>
				<view class="activity-content">
					{{text}}
				</view>
			</view>
			<!-- <view class="footer Footer" wx:if="{{share==1}}">
		    <view class="page-footer">
		      <image class="footer-img" src="http://minipos.posyun3721.com/image/marketing/loog.png"></image>
		      <text>商拓软件提供技术支持</text>
		    </view>
		  </view> -->

			<view class="buy" v-if="share==1">
				<view class="buy-choose">
					<!-- <navigator hover-class="none" url="/pages/Marketing/index/index" open-type="switchTab"> -->
					<view class="buy-view" @click="onIndex">
						<image class="buy-img" src="http://minipos.posyun3721.com/image/marketing/index1.png"></image>
						<text>首页</text>
					</view>
					<!-- </navigator> -->
					<view class="buy-view" @click="collect">
						<image class="buy-img" :src="img"></image>
						<text>收藏</text>
					</view>
				</view>
				<view class="buy-button type1">
					<button class="type1" v-if="activiStatus!='不可用'&&userID==0" @click="onStart" vlaue="">发起拼单
					</button>
					<button class="type1" v-else-if="activiStatus!='不可用'&&userID==1" open-type="share"
						hover-class="none">邀请拼团 </button>
					<button class="type1" v-else vlaue="">活动已结束</button>
				</view>
			</view>
			<view class="service none" v-if="share==1">
				<text>客服</text>
			</view>
		</view>

		<image class="music" :class="[musicUrl==''?'none':'']" id="musicUrl" src="../../../../Marketing/images/music.gif" mode='aspectFill' @click="onMusic"></image>

		<label class="layer" :class="[layerID===0?'none':'']">
			<view class="underlying" @click="onF"></view>
			<view class="layer-box">
				<view class="l-box">
					<view class="other-box" :class="[(item.GroupQty-item.ActQty)==0?'none':'']"
						v-for="(item,index) in usetsArr" :key="index" :data-id="item.Childid" @click="">
						<view class="initiator">
							<image class="initiator-img" :src="item.FAvatarUrl"></image>
							<text>{{item.FNiName}}</text>
						</view>
						<view class="part">
							<text>还差<text
									class="time">{{(item.GroupQty-item.ActQty)>2?2:item.GroupQty-item.ActQty}}人</text>成团</text>
							<button class="part-btu" @click="onChilds" v-if="userInfoUid!=item.Users">去拼单</button>
							<button class="part-btu" v-else>去邀请</button>
						</view>
					</view>
				</view>
			</view>
		</label>

		<!-- 	<view class="modal" :class="[isBeGranted==0?'':'none']">
			<view class="title1">申请获取您的用户信息</view>
			<button class="btn" open-type="getUserInfo" bindgetuserinfo="getUserInfo">确定</button>
		</view> -->
		<!-- <view class="mask" :class="[isBeGranted==0?'':'none']"></view> -->

		<dialog :class=" [FPhone==0?'':'none']" id='dialog' bind:confirmEvent='confirmEvent'
			bind:bindgetphonenumber='bindgetphonenumber'>
		</dialog>
	</view>
</template>

<script>
	const app = getApp();
	const innerAudioContext = uni.createInnerAudioContext();
	let seckillacid = '',
		usersData = '', //
		tiemDate = '', //时间
		coll = true; //
	export default {
		data() {
			return {
				list: ['活动详情', '活动规则'], //
				img: 'http://minipos.posyun3721.com/image/marketing/collect1.png', //

				id: 0, //活动的3种模式；0=>拼团 1=>秒杀 2=>砍价 //底部导航按钮的2种模式;1=>秒杀模式 2=>砍价模式
				activityTypeID: 0, //活动类型的样式 0=>活动详情 1=>活动规则
				swiperImg: [],
				swiperId: 0, //判断是否是视频还是图片
				goodId: '',

				days: 0, //时间
				hours: 0,
				minutes: 0,
				seconds: 0,

				spellData: '', //主活动内容
				childSet: '', //子活动的内容
				spellChildId: '', //子拼团id
				spellacid: '', //团购id
				residuals: '', //剩余数量
				browse: '', //浏览人数
				participate: '', //参与人数
				activiStatus: '', //主活动的状态
				text: '', //活动说明和规则
				swiper: ['http://minipos.posyun3721.com/image/marketing/rec1.png'], //



				usetsArr: '', //参加活动用户信息
				usersImg: '', //
				userID: 0, //用于主拼团，判断是否已经发起拼团

				AcChild: 0, //子类活动查询,加入子拼团
				share: 1, //是否是分享链接进来的；0=>是 1=>不是
				uid: '', //指向当前分享链接的用户(需要帮忙的用户)
				layerID: 0, //显示和隐藏更多查看表，0=>隐藏 1=>显示
				isBeGranted: 1, //授权登录状态码
				FPhone: 1, //手机授权登录状态码
				usersPrice: 0, //

				userInfoUid: '', //当前用户的Uid
				userInfoId: 0, //用于子拼团，判断是否已经参加了该拼团

				distributor: '', //分销人员的id

				musicUrl: '', //背景音乐地址
				musics: true, //背景音乐播放的状态
				TimeOut: '', //定时器
			}
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			//console.log('app.appdata',app.appdata)
			//记录0=>主页 1=>详情页
			uni.setStorageSync('Recordid', 1);
			//记录该活动时间是否已过期
			uni.removeStorageSync('timeOut');
			uni.showLoading({
				title: '加载中......',
			})

			var self = this;
			//console.log('app',app.appdata,app.appdata.activity);
			let activitData = '';
			// activitData = app.appdata.activity || '';
			// if (activitData != '') { //小程序与小程序之间的跳转
			// 	let scan = app.appdata.scan;
			// 	uni.setStorageSync('options', scan); //登录时需要记录的入口参数
			// 		this.id= activitData.id;
			// 		this.spellacid= activitData.groupId;
			// 		this.share= 1;
			// 	// this.callback(1);
			// 	this.login();
			// } else {
			if (options) {
				if (options.AcChild) {
					this.id = options.id;
					this.spellacid = options.Acid;
					this.spellChildId = options.ChildId;
					this.AcChild = options.AcChild;
					this.distributor = options.distributor;
					this.callback(2);
				} else {
					if (options.share == 0) {
						let shar = options.Sharedata;
						if ((typeof shar) == 'string') {
							shar = JSON.parse(shar);
						}
						let option = {
							FItemID: shar.fItemID,
							hostid: shar.hostid,
							PagePath: 'Marketing'
						};
						uni.setStorageSync('options', option);
						uni.setStorageSync('Sharedata', options.Sharedata)
						if (shar.uid != '') {
							this.id = shar.id;
							this.spellacid = shar.groupId;
							this.share = options.share;
							this.uid = shar.uid;
							this.spellChildId = shar.childId;
							this.AcChild = 1;
							this.distributor = shar.distributor;
						} else {
							this.id = shar.id;
							this.spellacid = shar.groupId;
							this.share = 1;
							this.AcChild = 0;
						}
						uni.setStorageSync('stockId', shar.fItemID);
						uni.setStorageSync('FItemID', shar.fItemID); //门店id
						uni.setStorageSync('lastHostid', shar.hostid); //旧的    
					} else {
						let shar = '';
						if (options.Sharedata) {
							shar = options.Sharedata;
							shar = JSON.parse(shar); //分享链接传递过来的参数
							let option = {
								FItemID: shar.fItemID,
								stockId: shar.fItemID,
								hostid: shar.hostid,
								PagePath: 'Marketing'
							};
							uni.setStorageSync('stockId', shar.fItemID);
							uni.setStorageSync('options', option);
						}
						//console.log(shar);
						/**
						 * 分销人员的判断(该活动是否由分销人员分享出来的)
						 * 0 -> 没有分销人员
						 * distributor -> 由分销人员分享的活动(分销人员的id)
						 */
						if (shar.distributor !== undefined) {
							this.id = shar.id;
							this.spellacid = shar.groupId;
							this.distributor = shar.distributor;
							this.share = 1;
						} else {
							this.id = options.id;
							this.spellacid = options.groupId;
							this.share = 1;
						}
					}
					var loginId = uni.getStorageSync('LoginID');
					if (loginId == 1) {
						let ID = this.share == 0 ? 2 : 1;
						this.callback(ID);
					} else {
						this.login();
					}
				}
			}
			// }
			uni.setStorageSync('Uid', this.uid)
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			var loginId = uni.getStorageSync('LoginID');
			if (loginId == 1) {
				var phoneID = uni.getStorageSync('PhoneID');
				this.FPhone = phoneID;
			}

		},

		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {
			// //console.log('eee')
			//离开当前页面时，把wx.createInnerAudioContext()的实例去掉/销毁
			innerAudioContext.destroy();
			clearTimeout(this.TimeOut);
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function() {
			// //console.log('www')
			if (this.musics == true) {
				this.musics = !this.musics;
			}
			//离开当前页面时，把wx.createInnerAudioContext()的实例去掉/销毁
			innerAudioContext.stop();
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {
			let Sharedata = this.$util.onShare(),
				share = Sharedata.share;
			if (this.distributor != '') {
				Sharedata.distributor = this.distributor;
			} else {
				Sharedata.distributor = '';
			}
			let childSet = this.childSet;
			for (var i in childSet) {
				if (Sharedata.childId == childSet[i].Childid) {
					Sharedata.uid = childSet[i].Uid;
				}
			}
			if (this.userInfoId == 2) {
				Sharedata.uid = '';
				Sharedata.childId = '';
			}
			Sharedata = JSON.stringify(Sharedata);
			return {
				title: '一起来拼团啊',
				path: '/pages/Marketing/index/select/select1/select1?Sharedata=' + Sharedata + '&share=' + share,
			}
			// const promise = new Promise(resolve => {
			// 	setTimeout(() => {
			// 		resolve({
			// 			title: '一起来拼团啊'
			// 		})
			// 	}, 2000)
			// })
			// //console.log(Sharedata, share)
			// Sharedata = JSON.stringify(Sharedata);
			// return {
			// 	title: '一起来拼团啊',
			// 	path: '/pages/Marketing/index/select/select1/select1?Sharedata=' + Sharedata + '&share=' + share,
			// 	promise
			// }
		},
		methods: {

			login() {
				wx.login({ //登录
					success: res => {
						let code = res.code;
						this.$util.Login(code).then(res => {
							if (res == 1) {
								let id = uni.getStorageSync('isBeGranted');
								this.isBeGranted = id;
								let ID = this.share == 0 ? 2 : 1;
								this.callback(ID);
							} else {
								this.isBeGranted = 0;
							}
						}) //.catch(error => //console.log(error));
					}
				})
			},
			callback: async function(id) {
				this.$util.GetTitle();
				let url = '',
					data = {},
					userInfoId = '',
					userInfoUid = '',
					user = [],
					Spellgroup = {
						AcChild: this.AcChild,
						id: this.id,
						uid: this.uid,
						activityTypeID: this.activityTypeID,
						share: this.share,
					};
				if (id == 1) { //活动详情
					url = 'Sale/GetGroupSaleDtl';
					data = {
						groupid: this.spellacid
					}
				} else if (id == 2) { //获取子类活动的详情
					url = 'Sale/GroupChildDtl';
					data = {
						groupid: this.spellacid, //拼团id
						childid: this.spellChildId //子拼团id
					};
				}
				let Spelldata = await this.$util.add(url, data, Spellgroup);
				let childSet = Spelldata.childSet; //子拼团发起人的集合
				if (Spelldata.Usets != '') {
					let childUserData = await this.$util.childUser(Spelldata.Usets);
					//console.log(childUserData);
					/** 
					 * childUserData.user 当前子拼团的参与人集合
					 */
					if (this.share == 0) {
						let userInfo = wx.getStorageSync('MuserInfo')
						for (var i in childUserData.user) {
							if (userInfo.nickName == childUserData.user[i].FNiName) {
								userInfoId = 1;
								if (childUserData.user.length == Spelldata.goodsData.FGroupUQty) {
									userInfoId = 2;
								}
							}
							for (var j in childSet) {
								if (childSet[j].Uid == childUserData.user[i].FItemID) {
									childSet[j].FAvatarUrl = childUserData.user[i].FAvatarUrl;
									childSet[j].FNiName = childUserData.user[i].FNiName;
									user.push(childSet[j]);
									userInfoUid = childUserData.user[i].FItemID;
								}
							}
						}
					} else {
						user = childUserData.user;
						userInfoUid = childUserData.userInfoUid
					}
					uni.setStorageSync('Uid', userInfoUid)
					//console.log(user, childSet, userInfoUid, userInfoId);    
					this.usersImg = childUserData.usersImg;
					this.usetsArr = user;
					this.userID = childUserData.userID; //用于主拼团，判断是否已经发起拼团
					this.userInfoUid = userInfoUid;
					this.userInfoId = userInfoId; //用于子拼团，判断是否已经参加了该拼团
					this.distributor = childUserData.distributor;
				}
				uni.hideLoading();
				seckillacid = Spelldata.groupId; //团购id
				usersData = Spelldata.usersData; //参活动的用户的内容
				tiemDate = Spelldata.tiemDate; //活动结束的时间
				coll = Spelldata.coll; //
				this.spellData = Spelldata.goodsData; //主活动内容
				// this.childSet = Spelldata.childSet; //子活动的内容
				this.spellChildId = Spelldata.childId; //子活动的id
				this.residuals = Spelldata.residuals; //剩余数量
				this.browse = Spelldata.browse; //浏览人数
				this.participate = Spelldata.participate; //参与人数
				this.activiStatus = Spelldata.activiStatus;
				this.text = Spelldata.text; //活动规则和活动说明
				this.swiper = Spelldata.swiper; //图片
				// usersPrice= Seckilldata.usersPrice,//
				this.img = Spelldata.collImg;
				setTimeout(() => {
					this.musicUrl = Spelldata.FMusicUrl; //
					//自动播放背景音乐
					innerAudioContext.src = Spelldata.FMusicUrl;
					innerAudioContext.autoplay = true;
					innerAudioContext.loop = true;
					innerAudioContext.play();
				}, 600)
				this.onCountdown(tiemDate);
			},

			//发起子拼团活动,先判断是否有填写地址，有则下一步，没有则需要去填写地址，才可以下一步
			onStart: function() {
				var self = this,
					datas = self.spellData;
				datas = JSON.stringify(datas);
				let url = '';
				let data = {};
				//记录该活动时间是否已过期
				let timeOut = uni.getStorageSync('timeOut');
				if (timeOut == 1) {
					uni.showModal({
						title: '活动提示',
						content: '该活动已结束，请重新选择活动参与',
					})
				} else {
					//获取收货地址
					// select.address(0);
					
					let token = uni.getStorageSync('Token'); //Token值
					uni.request({
						url: this.$Url + 'sale/CheckTokenLogin',
						data: '',
						method: 'POST',
						header: {
							'token': token,
							'cookie': uni.getStorageSync('Cookies'),
						},
						success: (res) => {
							let id = uni.getStorageSync('LoginID');
							if (res.data.msg == 'success' && id == 1) {
								
								if (this.AcChild == 1) {
									//加入子拼团
									uni.navigateTo({
										url: '/pages/Marketing/index/pay/pay?id=' + this.id + '&childId=' + this
											.childId + '&goodsData=' + datas + '&addressId=0&AcChild=1&distributor=' + this
											.distributor,
									})
								} else {
									//创建子拼团
									uni.navigateTo({
										url: '/pages/Marketing/index/pay/pay?id=' + this.id + '&goodsData=' + datas +
											'&addressId=0&distributor=' + this.distributor,
									})
								}
							}else{
								uni.showModal({
									title: '提示',
									content: '尚未登录，是否先前去登录',
									success: (res) => {
										if (res.confirm) {
											uni.navigateTo({
												url: `/pages/public/login`
											})
										}
									}
								})
							}
						}
					})
				}
			},
			//子拼团的跳转
			onChilds: async function(e) {
				//console.log(e);
				let id = e.currentTarget.dataset.id;
				// let a = await select.onChilds(seckillacid); 
				this.AcChild = 1;
				this.childId = id;
				this.onStart();
				// this.onLoad();
			},

			//导航的切换
			onSwitch: function(e) {
				//console.log(e)
				let data = this.spellData,
					id = e.target.dataset.id;
				let Text = id == 0 ? data.FIntro : data.FRuleIntro;
				this.activityTypeID = id;
				this.text = Text;
			},
			//倒计时
			onCountdown: function(endDateStr) {

				var self = this;
				var data = this.$util.onCountdown(endDateStr);
				// //console.log(data);
				if (data != '') {
					this.days = data.days;
					this.hours = data.hours;
					this.minutes = data.minutes;
					this.seconds = data.seconds;
					if (data.type == 1) {
						clearTimeout(this.TimeOut)
					} else {
						//延迟一秒执行自己
						this.TimeOut = setTimeout(function() {
							self.onCountdown(endDateStr);
						}, 1000)
					}
				}
			}, //获取更多子拼团
			onPage: function() {
				this.$util.util()('Sale/GetGroupChildSet', {
					groupid: seckillacid,
					page: 1,
					size: 10,
				}).then(res => {
					//console.log(res);
				});
			},
			//查看更多(只有拼团有)
			onFind: function() {
				let id = this.id;
				if (id == 0) {
					this.layerID = 1
				}
				this.onPage();
			},
			onF: function() {
				this.layerID = 0;
			},
			//分享链接进来，判断还没有授权的
			getUserInfo: function(e) {
				this.$util.getUserInfo().then(res => {
					if (res == 1) {
						uni.setStorageSync('isBeGranted', 1);
						uni.setStorageSync('LoginID', 1) //缓存登录的状态
						this.isBeGranted = 1;
						let ID = this.share == 0 ? 2 : 1;
						this.callback(ID);
					} else {
						uni.showModal({
							title: '授权提示',
							content: '授权失败！点击确认按钮，重新进入',
							success: res => {
								if (res.confirm) {
									this.isBeGranted = 0
								}
							}
						})
					}
				}) //.catch(error=>//console.log(error));
			},
			//收藏
			collect: function() {
				var self = this;
				if (coll) {
					coll = false;
					self.img = 'http://minipos.posyun3721.com/image/marketing/collect2.png';
				} else {
					coll = true;
					self.img = 'http://minipos.posyun3721.com/image/marketing/collect1.png';
				}
				let goods = this.spellData,
					goodsid = seckillacid,
					id = this.id,
					actype = '';
				id == 0 ? actype = 1 : '';
				this.$util.util('Sale/SaveMemberCollect', {
					acid: goodsid, //活动id
					actype: actype, //活动类型
					goodsid: goods.FRangeExt, //商品id
					imgurl: goods.FImages, //商品图片
					title: goods.FName, //标题
				}, 'POST').then(res => {
					//console.log(res);
				});
			},
			//返回首页
			onIndex: function() {
				uni.reLaunch({
					url: '/pages/Marketing/index/index',
				})
			},
			//获取手机号
			bindgetphonenumber: async function(e) {
				var self = this;
				let phoneData = e.detail.detail;
				let phoneID = await select.bindgetphonenumber(phoneData);
				//console.log(phoneID);
				self.FPhone = phoneID;
			},
			//暂停音乐
			onMusic() {
				if (this.musics === true) {
					innerAudioContext.pause(); //暂停音乐
				} else {
					innerAudioContext.play(); //暂停音乐
				}
				this.musics = !this.musics;
			},
		}
	}
</script>

<style lang='scss'>
	@import url("../../../../../common/app.wxss");

	view,
	scroll-view,
	swiper,
	swiper-item,
	cover-view,
	cover-image,
	icon,
	text,
	rich-text,
	progress,
	button,
	checkbox,
	form,
	input,
	label,
	radio,
	slider,
	switch,
	textarea,
	navigator,
	audio,
	camera,
	image,
	video {
		-webkit-box-sizing: border-box;
		box-sizing: initial;
	}

	.content {
		width: 100%;
		height: auto;
	}

	.head {
		width: 100%;
		height: auto;
		background-color: #fff;
		border-bottom: 20rpx solid #F6F6F6;
	}

	.userT {
		margin-bottom: 0px;
		font-size: 16px;
		display: block;
		text-align: center;
	}

	.music {
		position: fixed;
		top: 100rpx;
		right: 50rpx;
		width: 80rpx;
		height: 80rpx;
	}
</style>
